/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/views/layout/Layout';
import ParentLayout from '@/views/layout/ParentLayout';

const wechatRouter = {
  path: '/wx',
  component: Layout,
  redirect: 'noredirect',
  name: 'wx',
  meta: {
    title: 'wx',
    icon: 'wechat',
    access: ['menu:wx']
  },
  children: [
    {
      path: 'mp',
      component: ParentLayout,
      redirect: 'noredirect',
      name: 'wxMp',
      meta: {
        title: 'wxMp',
        icon: 'wechat-mp',
        access: ['menu:wx:mp']
      },
      alwaysShow: true,
      children: [
        {
          path: 'config',
          component: () => import('@/views/wx/mp/config/index'),
          name: 'wxMpConfig',
          meta: {
            title: 'wxMpConfig',
            icon: 'configure',
            access: ['menu:wx:mp:config']
          }
        },
        {
          path: 'menu/:id',
          component: () => import('@/views/wx/mp/menu/index'),
          name: 'wxMpMenu',
          meta: {
            title: 'wxMpMenu',
            icon: 'menu',
            access: ['menu:wx:mp']
          },
          hidden: true
        },
        {
          path: 'msg/:id',
          component: () => import('@/views/wx/mp/msg/index'),
          name: 'wxMpMsg',
          meta: {
            title: 'wxMpMsg',
            icon: 'msg'
          },
          hidden: true
        }
      ]
    }
  ]
};

export default wechatRouter;
